var t = require;
var e = module;
var o = exports;
var i, n = this && this.__extends || (i = function(t, e) {
    return (i = Object.setPrototypeOf || {
        __proto__: []
    }
    instanceof Array &&
    function(t, e) {
        t.__proto__ = e
    } ||
    function(t, e) {
        for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
    })(t, e)
},
function(t, e) {
    function o() {
        this.constructor = t
    }
    i(t, e),
    t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
}),
a = this && this.__decorate ||
function(t, e, o, i) {
    var n, a = arguments.length,
    r = a < 3 ? e: null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);
    else for (var s = t.length - 1; s >= 0; s--)(n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
    return a > 3 && r && Object.defineProperty(e, o, r),
    r
};
Object.defineProperty(o, "__esModule", {
    value: !0
});
var r = t("RocketItem"),
s = t("BroadCastMessage"),
l = t("GameConstant"),
c = t("GameLogic"),
d = cc._decorator,
h = d.ccclass,
p = d.property,
u = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.node_scene = null,
        e._gameLogic = new c.GameLogic,
        e._gameControl = null,
        e.bCollider = !1,
        e.bLBodyCollider = !1,
        e.bLWheel0Collider = !1,
        e.bLWheel1Collider = !1,
        e.bRBodyCollider = !1,
        e.bRWheel0Collider = !1,
        e.bRWheel1Collider = !1,
        e
    }
    return n(e, t),
    e.prototype.init = function(t) {
        this._gameControl = t
    },
    e.prototype.onGameStart = function() {
        this.resetData(),
        this.bCollider = !0
    },
    e.prototype.onGameOver = function() {
        this.bCollider = !1,
        this.resetData()
    },
    e.prototype.onGameBoutStart = function() {
        this.resetData(),
        this.bCollider = !0
    },
    e.prototype.onGameBoutOver = function() {
        this.resetData(),
        this.bCollider = !1
    },
    e.prototype.resetData = function() {
        this.bLBodyCollider = !1,
        this.bLWheel0Collider = !1,
        this.bLWheel1Collider = !1,
        this.bRBodyCollider = !1,
        this.bRWheel0Collider = !1,
        this.bRWheel1Collider = !1,
        this._gameControl.setCanTouchBtn(l.Collide_Car_Tag.Left, !1),
        this._gameControl.setCanTouchBtn(l.Collide_Car_Tag.Right, !1)
    },
    e.prototype.onCollisionEnter = function(t) {
        if (this.bCollider) switch (this._gameLogic.getColliderWeaponTag(t.tag)) {
            case l.Collide_Weapon_Tag.Hammer:
            case l.Collide_Weapon_Tag.Saw:
                break;
            case l.Collide_Weapon_Tag.Rocket:
                this.removeRocket(t);
            break;
            case l.Collide_Weapon_Tag.ElecSaw:
        }
    },
    e.prototype.onCollisionExit = function() {},
    e.prototype.onEnterCarBody = function(t) {
        l.Collide_Car_Tag.Left == t ? this.bLBodyCollider = !0 : l.Collide_Car_Tag.Right == t && (this.bRBodyCollider = !0),
        this.isCarEnterLand(t)
    },
    e.prototype.onEnterCarWheel = function(t, e) {
        l.Collide_Car_Tag.Left == t ? l.Physics_Body_Tag.Wheel0 == e ? this.bLWheel0Collider = !0 : l.Physics_Body_Tag.Wheel1 == e && (this.bLWheel1Collider = !0) : l.Collide_Car_Tag.Right == t && (l.Physics_Body_Tag.Wheel0 == e ? this.bRWheel0Collider = !0 : l.Physics_Body_Tag.Wheel1 == e && (this.bRWheel1Collider = !0)),
        this.isCarEnterLand(t)
    },
    e.prototype.onExitCarBody = function(t) {
        l.Collide_Car_Tag.Left == t ? this.bLBodyCollider = !1 : l.Collide_Car_Tag.Right == t && (this.bRBodyCollider = !1),
        this.isCarExitLand(t)
    },
    e.prototype.onExitCarWheel = function(t, e) {
        l.Collide_Car_Tag.Left == t ? l.Physics_Body_Tag.Wheel0 == e ? this.bLWheel0Collider = !1 : l.Physics_Body_Tag.Wheel1 == e && (this.bLWheel1Collider = !1) : l.Collide_Car_Tag.Right == t && (l.Physics_Body_Tag.Wheel0 == e ? this.bRWheel0Collider = !1 : l.Physics_Body_Tag.Wheel1 == e && (this.bRWheel1Collider = !1)),
        this.isCarExitLand(t)
    },
    e.prototype.isCarEnterLand = function(t) {
        l.Collide_Car_Tag.Left == t ? (this.bLBodyCollider || this.bLWheel0Collider || this.bLWheel1Collider) && this._gameControl.setCanTouchBtn(t, !0) : l.Collide_Car_Tag.Right == t && (this.bRBodyCollider || this.bRWheel0Collider || this.bRWheel1Collider) && this._gameControl.setCanTouchBtn(t, !0)
    },
    e.prototype.isCarExitLand = function(t) {
        l.Collide_Car_Tag.Left == t ? this.bLBodyCollider || this.bLWheel0Collider || this.bLWheel1Collider || this._gameControl.setCanTouchBtn(t, !1) : l.Collide_Car_Tag.Right == t && (this.bRBodyCollider || this.bRWheel0Collider || this.bRWheel1Collider || this._gameControl.setCanTouchBtn(t, !1))
    },
    e.prototype.removeRocket = function(t) {
        s.default.getInstance().SendMessage(l.Game_Broadcast_Func.Audio, l.Game_Audio_ID.rocket_hit),
        t.node.parent.getComponent(r.default).removeItem()
    },
    a([p(cc.Node)], e.prototype, "node_scene", void 0),
    a([h], e)
} (cc.Component);
o.default = u